home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / demos / GL / snurb / defines.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.4 KB  |  109 lines

  1. /*
  2.  * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #define MAX_PATCHES 100
  18.  
  19. #define ON 1
  20. #define OFF 0
  21.  
  22. #define NONE -1
  23.  
  24. /* NUMPOINTS = NUMKNOTS - ORDER
  25.     Everything is Cubic Bezier, so ... */
  26. #define NUMKNOTS    8    /* number of knots in each dimension of NURBS */
  27. #define ORDER        4    /* order in each dimension of NURBS */
  28. #define NUMPOINTS 4
  29.  
  30. /* user interface tools */
  31. #define MOVE_TOOL 1
  32. #define EDIT_TOOL 2
  33. #define SCALE_TOOL 3
  34. #define SHARP_ZIP_TOOL 4
  35. #define SMOOTH_ZIP_TOOL 5
  36. #define ROUND_ZIP_TOOL 6
  37. #define UNZIP_TOOL 7
  38.  
  39. #define SHARP 1
  40. #define SMOOTH 2
  41. #define ROUND 3
  42.  
  43. /* draw polygons to a maximum of this when picking (higher for speed) */
  44. #define PICKING_TOLERANCE 100.0
  45.  
  46. /* primitives */
  47. #define PLANE 1
  48. #define HEMISPHERE 2
  49. #define SPHERE 3
  50. #define CYLINDER 4
  51. #define CUBE 5
  52. #define TEAPOT 6 /* yes, this IS a SIGGRAPH demo */
  53.  
  54. /* node types */
  55. #define ROOT 1
  56. #define OBJECT 2
  57. #define PATCH 3
  58.  
  59.  
  60. /* Data Structure */
  61.  
  62. typedef float Mesh[4][4][3];
  63.  
  64.  
  65. struct zip_struct
  66. {
  67.     Boolean zipped; /* is this edge zipped ? */
  68.     int zip_type;    /* what type - SHARP, SMOOTH, ROUND */
  69.     struct node_struct *patch; /* which patch is it zipped to */
  70.     int edge; /* which edge on the destination patch */
  71.     int s_index;
  72.     int s_step;
  73.     int t_index;
  74.     int t_step;
  75.     int i_s_index;
  76.     int i_s_step;
  77.     int i_t_index;
  78.     int i_t_step;
  79. };
  80.  
  81.  
  82. struct patch_struct
  83. {
  84.     Mesh control;
  85.     Boolean affected[4][4];
  86.     struct zip_struct *zipper[4];
  87. };
  88.  
  89.  
  90. struct node_struct
  91. {
  92.     int node_id; /* only set when writing out file */
  93.     int node_type; /* ROOT, OBJECT or PRIMITIVE */
  94.  
  95.     struct node_struct
  96.             *parent,
  97.             *child,
  98.             *sibling,
  99.             *prev_sibling;
  100.  
  101.     struct patch_struct *patch; /* only used if node_type == PATCH */
  102.  
  103.     Boolean selected; /* is this node selected */
  104. };
  105.  
  106.  
  107.  
  108.  
  109.